package aliyunCli

import (
	"fmt"
	"tushare/conf"

	ecs "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
)

type StartInstance struct{}

func (si StartInstance) StartInstance(instanceId string) {
	client, err := ecs.NewClientWithAccessKey("cn-hangzhou", conf.AccessKeyID, conf.AccessKeySecret)

	request := ecs.CreateStartInstanceRequest()
	request.Scheme = "https"

	request.InstanceId = instanceId

	_, err = client.StartInstance(request)
	if err != nil {
		fmt.Print(err.Error())
	}

}
